package cn.zero.util;

import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

public class UtilContext {

	public static ApplicationContext APPLICATION_CONTEXT;
	
	public static String ENCODING = "UTF-8";
	
	public static Object getBean(String name) {
		return APPLICATION_CONTEXT.getBean(name);
	}
	
	public static <T> T getBean(Class<T> clazz) {
		return APPLICATION_CONTEXT.getBean(clazz);
	}
	
	public static <T> T getBean(String name, Class<T> calzz) {
		return APPLICATION_CONTEXT.getBean(name, calzz);
	}
	
	public static Environment getEnvironment() {
		return APPLICATION_CONTEXT.getEnvironment();
	}
	
}
